Directly Manipulating Tag Object Contents
Unlike with most properties of most objects, QuickDraw GX allows you to directly manipulate a tag object's contents in QuickDraw GX memory. This capability is provided as a convenience, so that you do not have to make a copy of the data; you can achieve the same results by working with a copy of the information in application memory and then replacing it in the object, using theGXGetTag
andGXSetTag
functions. See "Getting and Setting a Tag Object's Tag Type and Contents" on page 8-10 for information on working withGXGetTag
andGXSetTag
.As with
GXGetTag
andGXSetTag
, the direct-manipulation functions do not provide you with information about the format or organization of the contents of a tag object; they simply give you a pointer to the contents. How you manipulate that information depends on the type of tag you are accessing.Working with data in QuickDraw GX memory requires that you lock the data before accessing it so that it cannot be relocated or unloaded from memory until you are finished. You first call the
GXLockTag
function to make sure the tag object doesn't move until you are finished with it. You then call theGXGetTagStructure
function, which returns a pointer to and the size of the shape's contents. You can then modify the data as needed. Once finished, you callGXUnlockTag
to free the tag object for relocation as needed by QuickDraw GX.
The
- IMPORTANT
- Memory-handling complications can occur with locked objects. Locking an object fragments the QuickDraw GX heap, which can result in lower performance. Furthermore, if a fragmented-memory condition occurs during a call, QuickDraw GX may unlock all objects and restart the call. Therefore, be careful about performing memory-intensive operations while there are locked objects in QuickDraw GX memory; they may become unlocked without warning.
![]()
GXLockTag
function is described on page 8-21. TheGXGetTagStructure
function is described on page 8-23. TheGXUnlockTag
function is described on page 8-22.